"Line Resequencer"
By Mike Peace
CURSOR 2 no. 5 (January/February 1981): 89.


Instructions from "Cursor" newsletter:


Ever want to change all the line numbers in a program without re-typing the 
whole program?  Well, here is the answer that's sure to do the trick.  There 
are a few drawbacks however, it can't change the GOSUBS or the GOTO's to 
correspond to the new line numbers.  So, you may find it a good idea to 
initialize your subroutines by typing the original line number after the word 
"RETURN", like this:

25 FOR A=1T0 10;BOX A,0,A,3,3;NEXT A;RETURN 25

After you have done this to all your subroutines, you can go ahead and change 
the line numbers using the "Line Resequencing" program.  Now you will have new 
numbers on your subroutines, but you will have the old line numbers initialized 
so you can find the new numbers to re-direct your old GOSUBS to.

Input the following program and record it for safe keeping. Next input the 
program you wish to change (make sure that the line numbers are all less than 
500, and be sure to have at least 100 SZ after both programs are entered).

Now type in GOTO 500, and key in a line number sequence UNDER 50 (much less if 
it is a long program). You must not have your sequence go past 500 or you will 
be eating up the resequencing program.

After entering the sequence number, you will hear the computer beep as it pulls 
out each line number and enters it into memory.  Finally a quick scale of 
notes, and it will begin listing your new program and all the new line numbers.  
Now you just have to type in the new GOSUBS and GOTO's and your all set to put 
it on tape for safekeeping.

